<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8"/>
    <title>amis demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <link rel="stylesheet" href="amis/sdk.css"/>
    <link rel="stylesheet" href="amis/helper.css"/>
    <link rel="stylesheet" href="amis/iconfont.css"/>
    <!-- 这是默认主题所需的，如果是其他主题则不需要 -->
    <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11，如果要支持 IE11 请引用这个 css，并把前面那个删了 -->
    <!-- <link rel="stylesheet" href="sdk-ie11.css" /> -->
    <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果，所以可能有细节功能用不了，如果发现请报 issue -->
    <style>
        html,
        body,
        .app-wrapper {
          position: relative;
          width: 100%;
          height: 100%;
          margin: 0;
          padding: 0;
        }
    </style>
</head>
<body>
<div id="root" class="app-wrapper"></div>
<script src="amis/sdk.js"></script>
<script type="text/javascript">
    (function () {
      let amis = amisRequire('amis/embed');
      // 通过替换下面这个配置来生成不同页面
      let amisJSON = {
  "type": "page",
  "title": "语义搜索图片",
  "body": [
    {
      "id": "列表",
      "type": "crud",
      "api": {
        "url": "/分类搜图",
        "data": {},
        "requestAdaptor": "let 过滤标记 = 0;\nlet data = {};\ndata.大小 = context.perPage;\ndata.开始 = (context.page - 1) * context.perPage;\nif(context.文字){\n    data.文字 = context.文字;\n}\nreturn {\n    ...api,\n    data: data\n}\n",
        "adaptor": "return 批量查询转换(payload)"
      },
      "filter": {
        "type": "form",
        "className": "m-b-sm",
        "title": "",
        "mode": "inline",
        "wrapWithPanel": true,
        "body": [{ "type": "input-text", "name": "文字", "label": "文字" }],
        "actions": [
          {
            "type": "action",
            "label": "查询",
            "level": "primary",
            "actionType": "submit"
          },
          {
            "type": "action",
            "label": "重置",
            "level": "warning",
            "actionType": "reset"
          }
        ]
      },
      "bulkActions": [],
      "affixHeader": true,
      "placeholder": "无内容",
      "combineFromIndex": 0,
      "combineNum": 0,
      "filterTogglable": true,
      "footerToolbar": [
        { "type": "statistics", "align": "left" },
        { "type": "pagination", "align": "left" }
      ],
      "defaultParams": { "perPage": 15 },
      "mode": "cards",
      "card": {
        "type": "card",
        "body": [
          {
            "type": "image",
            "src": "${缩略图}",
            "originalSrc": "${缩略图+ '&s=1000'}",
            "enlargeAble": true,
            "showToolbar": true
          },
          { "name": "名称", "label": "名称" },
          { "name": "分数", "label": "分数" }
        ]
      },
      "columnsCount": 5,
      "keepItemSelectionOnPageChange": true,
      "labelTpl": "ID：${id}"
    }
  ]
};
      let amisScoped = amis.embed('#root', amisJSON);
    })();
</script>
<script src="通用处理.js"></script>
</body>
</html>